package com.test.qnews.activity;

import android.content.Intent;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.util.Log;

import com.test.qnews.R;
import com.test.qnews.adapter.StarPersonAdapter;
import com.test.qnews.fragment.DynamicFragment;
import com.test.qnews.fragment.MicroblogFragment;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by dllo on 16/1/20.
 */
public class StarPersonActivity extends BaseActivity{
    private ViewPager viewPager;
    private TabLayout tabLayout;
    private StarPersonAdapter starPersonAdapter;
    private List<Fragment> data;
    @Override
    protected int setLayout() {
        return R.layout.activity_person_star;
    }

    @Override
    protected void initView() {

        viewPager = (ViewPager) findViewById(R.id.viewpager_person_star);
        tabLayout = (TabLayout) findViewById(R.id.tablayout_person_star);

        data = new ArrayList<>();
        data.add(new DynamicFragment());
        data.add(new MicroblogFragment());
        starPersonAdapter = new StarPersonAdapter(getSupportFragmentManager(),data,this);
        viewPager.setAdapter(starPersonAdapter);
        tabLayout.setupWithViewPager(viewPager);


    }
}
